<%@page import="com.is.control.EvaluationControl"%>
<%@page import="com.is.model.Evaluation"%>
<%@page import="com.is.util.ParamUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.DesData"%>
<%@page import="com.is.control.StudentControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<title>修改学生综合评价</title>
</head>
<body>
<%
         DesData des = new DesData();
         int id=0;
         boolean flag=true;
         try{
          id = Integer.parseInt(des.decrypt(ParamUtil.getString(request,"id")));
          }catch(Exception e){
             flag = false;
             out.print("参数错误");
          }
       if(flag){
		        Evaluation e = EvaluationControl.getEvaluationById(id);
		        e.setStuId(ParamUtil.getInt(request, "stuId"));
		        String classId = des.encrypt(StudentControl.getStudent(ParamUtil.getInt(request, "stuId")).getClassId());
		        e.setStuyear(ParamUtil.getInt(request,"stuyear"));
		        e.setComments(ParamUtil.getString(request, "comments",e.getComments()));
		        e.setRecords(ParamUtil.getString(request, "records",e.getRecords()));
		        e.setScore(ParamUtil.getString(request,"score",e.getScore()));
		        e.setLevel(ParamUtil.getString(request, "level",e.getLevel()));
		        if(EvaluationControl.updateEvaluation(e)){
		        %>
		        <script>
		        $.dialog({
				    title: '综合评价',
				    content: '系统已修改您录入的学生信息,将返回到学生列表',
				    icon: 'succeed',
				    ok: function(){
		        		window.location.href="students_all.jsp?classId=<%=classId%>";//学生列表
				    }
				});
		        </script>
		        <%
		        }else{
		        %>
		        <script>
		        $.dialog({
				    title: '综合评价',
				    content: '抱歉，系统出错或您录入的信息有误，请重试',
				    icon: 'warning',
				    ok: function(){
		        	 		history.go(-1);
				    }
				});
		        </script>
        <% }}else{
           %>
		        <!-- a href="students_all.jsp">返回学生列表</a> -->
		        <%
        }
 %>
</body>
</html>